home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Freeware / AmiPCB / ARexx / MapKey.AmiPCB < prev    next >
Encoding:
Text File  |  2002-03-13  |  1.9 KB  |  65 lines

  1. /* MapKey
  2. Programmation d'une séquence de touches
  3. Version 1.00: 18 juillet 2001
  4. Version 1.01: 1er décembre 2001 (German localization by A. Greve)
  5. $VER: MapKey.AmiPCB 1.01 (® R.Florac, 1/12/2001) */
  6.  
  7. options results     /* indispensable pour récupérer le résultat des macros */
  8.  
  9. signal on error     /* pour l'interception des erreurs */
  10. signal on syntax
  11.  
  12. lf ='0a'x
  13.  
  14. fr = 'ARexx/InitVars.AmiPCB'()
  15.  
  16. 'VERSION'
  17. if result < 1.04 then do
  18.     select
  19.         when fr=1 then 'MESSAGE("Ce script nécessite'lf'AmiPCB version 1.04'lf'ou plus")'
  20.         when fr=2 then 'MESSAGE("Dieses Skript benötigt'lf'AmiPCB Version 1.04+")'
  21.         otherwise      'MESSAGE("This script needs'lf'AmiPCB version 1.04+")'
  22.     end
  23.     exit
  24. end
  25.  
  26. keys=getclip(key_sequence)
  27. if key~="" then keys=doublage_guillemets(keys)
  28. select
  29.     when fr=1 then 'INIT(KEY_SEQ,KEY_MACRO):KEY_SEQ=ASKTEXT("Séquence de touches'lf'à programmer ?'lf'Ex: shift-alt-f","'keys'")'
  30.     when fr=2 then 'INIT(KEY_SEQ,KEY_MACRO):KEY_SEQ=ASKTEXT("Zu programmierende'lf'Tasten-Sequenz ?'lf'Bsp: shift-alt-f","'keys'")'
  31.     otherwise       'INIT(KEY_SEQ,KEY_MACRO):KEY_SEQ=ASKTEXT("Keys sequence'lf'to program ?'lf'Ex: shift-alt-f","'keys'")'
  32. end
  33. key=result
  34. if key~="" then do
  35.     setclip(key_sequence,key)
  36.     select
  37.         when fr=1 then 'KEY_MACRO=ASKTEXT("Macro associée à "+KEY_SEQ,READMAP(KEY_SEQ))'
  38.         when fr=2 then 'KEY_MACRO=ASKTEXT("Zugeordnetes Makro für "+KEY_SEQ,READMAP(KEY_SEQ))'
  39.         otherwise      'KEY_MACRO=ASKTEXT("Associated macro for "+KEY_SEQ,READMAP(KEY_SEQ))'
  40.     end
  41.     if result~="" then 'MAP(KEY_SEQ,KEY_MACRO)'
  42. end
  43.  
  44. exit
  45.  
  46. doublage_guillemets: procedure
  47.     parse arg chaine
  48.     t=''
  49.     do i=1 to length(chaine)
  50.     c = substr(chaine,i,1)
  51.     if c='"' then c=c||'"'
  52.     t=t||c
  53.     end
  54.     return t
  55.  
  56. /* Traitement des erreurs, interruption du programme */
  57. syntax:
  58. erreur=RC
  59. Call 'ARexx/_Syntax.rexx'(fr,'MapKey.AmiPCB',SIGL,erreur)
  60. exit
  61.  
  62. error:
  63. Call 'ARexx/_Error.rexx'(fr,'MapKey.AmiPCB',SIGL)
  64. exit
  65.